package enterprises

import static org.junit.Assert.*;

import org.junit.Test;

import grails.test.*

class TypeProviderTests extends GrailsUnitTestCase {
	
	TypeProvider provider
	
    protected void setUp() {
		super.setUp()
        provider = new TypeProvider()
		mockForConstraintsTests(TypeProvider, [provider])		
    }

    protected void tearDown() {
        super.tearDown()
    }

    void testNullableName() {			
		assertFalse(provider.validate())			
		assertEquals "nullable", provider.errors["name"]		
    }
	
	void testEmptyName() {
		provider.name = ""
		
		assertFalse(provider.validate())
		assertEquals "blank", provider.errors["name"]
	}	
	
	void testSmallName() {
		provider.name = "as"
		
		assertFalse(provider.validate())
		assertEquals "minSize", provider.errors["name"]
	}
}
